package cn.hy.dataSync;

import cn.hy.dataSync.config.DataBaseType;
import cn.hy.dataSync.statistics.communication.CommunicationTool;
import cn.hy.dataSync.utils.RangeSplitUtils;
import cn.hy.dataSync.utils.RetryUtils;

import java.math.BigInteger;
import java.util.List;

public class Main {




    public static void main(String[] args) throws Exception {

        // System.out.println(System.getProperty("java.vm.vendor"));

        System.out.println( String.format("%,.2f", 224.33232) + "%");


    }


    private static void test03() {
        StringBuilder sb = new StringBuilder();
        sb.append("Total ");
        sb.append(12);
        sb.append(" | ");
        sb.append("Speed ");
        sb.append(12);
        sb.append(" | ");
        sb.append("Error ");
        sb.append(12);
        sb.append(" | ");
        sb.append(" All Task WaitWriterTime ");
        sb.append(1212);
        sb.append(" | ");
        sb.append(" All Task WaitReaderTime ");
        sb.append(13);
        sb.append(" | ");
        System.out.println(sb.toString());
    }

    private static void test02() throws Exception {
        RetryUtils.executeWithRetry(()-> {
            int sum = 0;
            for (int i = 0; i < 10; i++) {
                if (i % 2 ==0) {
                    throw new RuntimeException("e");
                }
                sum += i;
            }
            return sum;
        },3,2000,false);
    }

    private static void test0() {
        List<String> stringList = RangeSplitUtils.splitAndWrap("51", "57", 3, "id", "'", DataBaseType.MySql);
        System.out.println(stringList);

        List<String> strings2 = RangeSplitUtils.splitAndWrap(1L, 2000L, 4, "id");
        System.out.println(strings2);

        List<String> strings3 = RangeSplitUtils.splitAndWrap(new BigInteger("1"), new BigInteger("10000"), 4, "id");
        System.out.println(strings3);
    }
}
